<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
<script language="JavaScript">
  <!--
 	function submitForm(formId,action){
	 	$("#"+formId).attr("action",action);
	 	$("#"+formId).submit();
  }
  //-->
  </script>
</head>
<body>
<form id="configForm" action="" name="config" method="post">
<table width="90%" border="1">
  <tr>
    <td colspan="2" align="center">HTTP连接参数</td>
  </tr>
  <tr>
    <td align="right">最大连接数：</td>
    <td><input type="text" name="maxHttpConnection" id="textfield" value="200"/></td>
  </tr>
  <tr>
    <td align="right">并发连接数：</td>
    <td><input type="text" name="conCurHttpConnection" id="textfield2" value="20"/></td>
  </tr>
  <tr>
    <td align="right">连接超时时间：</td>
    <td><input type="text" name="httpConnectionTimeout" id="textfield3" value="10"/></td>
  </tr>
  <tr>
    <td align="right">读取数据超时时间：</td>
    <td><input type="text" name="httpReadTimeout" id="textfield4" value="10"/></td>
  </tr>
  <tr>
    <td colspan="2" align="center">抓取参数</td>
  </tr>
  <tr>
    <td align="right">并发线程数：</td>
    <td><input type="text" name="conCurThreadCount" id="textfield5" value="10"/></td>
  </tr>
  <tr>
    <td align="right">抓取网站：</td>
    <td><input type="text" name="url" id="textfield6" value="http://news.sina.com.cn"/></td>
  </tr>
  <tr>
    <td align="right">抓取网站名称：</td>
    <td><input type="text" name="urlName" id="textfield7" value="新浪新闻"/></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" name="button" id="button" value="保存参数" onclick="submitForm('configForm','')"/>
     <%
     Boolean isStart=(Boolean)request.getSession().getAttribute("CrawlerManagerStatus");
     if(isStart==null || Boolean.FALSE.equals(isStart)){ %>
      <input type="submit" name="button2" id="button2" value="开始抓取" onclick="submitForm('configForm','crawl_start_do.jsp')"/>
      <%}
     if(Boolean.TRUE.equals(isStart)){ 
     %>
    <input type="submit" name="button3" id="button3" value="停止抓取" onclick="submitForm('configForm','crawl_end_do.jsp')"/></td>
    <%} %>
  </tr>
</table>

<p><a href="index.jsp">返回主菜单</a></p>
</body>
</html>